package com.promise.jokerdream.database.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.promise.jokerdream.database.entity.WlmzGameConfigEntity

@Dao
interface WlmzGameConfigDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertOrUpdate(config: WlmzGameConfigEntity)
    
    @Update
    suspend fun update(config: WlmzGameConfigEntity)
    
    @Query("SELECT * FROM wlmz_game_config WHERE userId = :userId LIMIT 1")
    suspend fun getByUserId(userId: String): WlmzGameConfigEntity?
    
    @Delete
    suspend fun delete(config: WlmzGameConfigEntity)
    
    @Query("DELETE FROM wlmz_game_config WHERE userId = :userId")
    suspend fun deleteByUserId(userId: String)
}

